/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mortbay.jetty.pico.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Hnmtuan
 */
@Entity
@Table(name = "customer_logs")
@NamedQueries({
    @NamedQuery(name = "CustomerLogs.findAll", query = "SELECT c FROM CustomerLogs c"),
    @NamedQuery(name = "CustomerLogs.findByIdCusLogs", query = "SELECT c FROM CustomerLogs c WHERE c.idCusLogs = :idCusLogs"),
    @NamedQuery(name = "CustomerLogs.findByActions", query = "SELECT c FROM CustomerLogs c WHERE c.actions = :actions"),
    @NamedQuery(name = "CustomerLogs.findByLTime", query = "SELECT c FROM CustomerLogs c WHERE c.lTime = :lTime")})
public class CustomerLogs implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idCusLogs")
    private String idCusLogs;
    @Column(name = "Actions")
    private String actions;
    @Lob
    @Column(name = "Notes")
    private String notes;
    @Column(name = "LTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lTime;
    @JoinColumn(name = "Customer", referencedColumnName = "IdCus")
    @ManyToOne(optional = false)
    private Customer customer;

    public CustomerLogs() {
    }

    public CustomerLogs(String idCusLogs) {
        this.idCusLogs = idCusLogs;
    }

    public String getIdCusLogs() {
        return idCusLogs;
    }

    public void setIdCusLogs(String idCusLogs) {
        this.idCusLogs = idCusLogs;
    }

    public String getActions() {
        return actions;
    }

    public void setActions(String actions) {
        this.actions = actions;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Date getLTime() {
        return lTime;
    }

    public void setLTime(Date lTime) {
        this.lTime = lTime;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCusLogs != null ? idCusLogs.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CustomerLogs)) {
            return false;
        }
        CustomerLogs other = (CustomerLogs) object;
        if ((this.idCusLogs == null && other.idCusLogs != null) || (this.idCusLogs != null && !this.idCusLogs.equals(other.idCusLogs))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.mortbay.jetty.pico.entities.CustomerLogs[idCusLogs=" + idCusLogs + "]";
    }

}
